package com.holyant.goods.enums;

/** 商品实时价格币种枚举
 * @author zgx *
 * @date 2022年06月07日 13:43
 */
public enum GdsSkuPurchasePriceCurTypeEnum {

    RMB(10,"人民币"),
    HONG_KONG_DOLLAR(20,"港币"),
    DOLLAR(30,"美金"),
    AUSTRALIAN_DOLLAR(40,"澳元"),
    EUR(50,"欧元"),
    JPY(60,"日元");

    private final Integer code;
    private final String name;

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    GdsSkuPurchasePriceCurTypeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static String getNameByCode(Integer code) {
        for (GdsSkuPurchasePriceCurTypeEnum item : GdsSkuPurchasePriceCurTypeEnum.values()) {
            if (item.getCode().equals(code)) {
                return item.getName();
            }
        }
        return "";
    }

    public static Integer getCodeByName(String name) {
        for (GdsSkuPurchasePriceCurTypeEnum item : GdsSkuPurchasePriceCurTypeEnum.values()) {
            if (item.getName().equals(name)) {
                return item.code;
            }
        }
        return null;
    }
}
